package com.example.theadadmin.exception;

import com.example.theadadmin.vo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 注册功能
 * 全局异常处理器
 */

@RestControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(BisnessException.class)
    public Result<String> handleBisnessException(BisnessException bisnessException) {
        return Result.failure(bisnessException.getMessage());
    }
}
